<?php

namespace app\plugins\controller;

class upload extends \core\libs\controller {
    // 多图片上传
    public function multiple() {
        $this->display('upload-multiple');

        //初始化上传组件
        $multiple = new \core\libs\multiple();

        if($_SERVER['REQUEST_METHOD'] == 'POST') {	
            //开始上传
            $multiple ->init($_FILES["filename"]);	
        }
    }

    // 单图片上传
    public function image() {
        $this->display('upload-image');

        //初始化上传组件
        $multiple = new \core\libs\multiple();

        if($_SERVER['REQUEST_METHOD'] == 'POST') {	
            //开始上传
            $multiple ->init($_FILES["filename"]);	
        }
    }

    // 文件上传
    public function file() {
        $this->display('upload-file');

        //初始化上传组件
        $multiple = new \core\libs\multiple("file");

        if($_SERVER['REQUEST_METHOD'] == 'POST') {	
            //开始上传
            $multiple ->init($_FILES["filename"]);	
        }
    }

    // 视频上传
    public function video() {
        $this->display('upload-video');

        //初始化上传组件
        $multiple = new \core\libs\multiple("video");

        if($_SERVER['REQUEST_METHOD'] == 'POST') {	
            //开始上传
            $multiple ->init($_FILES["filename"]);	
        }
    }
}